<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Goodform_Model Extends Model {

	var $table = 'people';
	
	function Goodform_Model($table)
	{
		parent::Model();
		
		$this->table = $table;
	}

    function get($ID = NULL)
	{
		if (isset($ID)) {
			$this->db->where('ID', $ID);
            $query = $this->db->get($this->table);
            return $query->row_array();
		} else {
			$query = $this->db->get($this->table);
            return $query->result_array();
		}
	}
	
	function insert($input) {
		return $this->db->insert($this->table, $input);
	}
	
	function update($ID, $input) {
		$this->db->where('ID', $ID);
		return $this->db->update($this->table, $input);
	}
	
	function delete($ID) {
		$this->db->where('ID', $ID);
		return $this->db->delete($this->table);
	}
}

?>